home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / rexx.c < prev    next >
C/C++ Source or Header  |  1997-06-17  |  31KB  |  1,221 lines

  1. /// Include
  2. #include <stdarg.h>
  3. #include <string.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6.  
  7.  
  8. #define INTUI_V36_NAMES_ONLY
  9. #define ASL_V38_NAMES_ONLY
  10. #define CATCOMP_NUMBERS
  11.  
  12. #include <exec/nodes.h>                 // exec
  13. #include <exec/lists.h>
  14. #include <exec/memory.h>
  15. #include <exec/ports.h>
  16. #include <exec/libraries.h>
  17. #include <intuition/intuition.h>        // intuition
  18. #include <intuition/screens.h>
  19. #include <intuition/sghooks.h>
  20. #include <intuition/gadgetclass.h>
  21. #include <dos/dos.h>                    // dos
  22. #include <dos/rdargs.h>
  23. #include <rexx/rexxio.h>                // rexx
  24. #include <rexx/errors.h>
  25. #include <rexx/storage.h>
  26. #include <libraries/gadtools.h>         // libraries
  27. #include <libraries/asl.h>
  28. #include <libraries/reqtools.h>
  29. #include <libraries/locale.h>
  30. #include <clib/exec_protos.h>           // protos
  31. #include <clib/dos_protos.h>
  32. #include <clib/rexxsyslib_protos.h>
  33. #include <clib/locale_protos.h>
  34. #include <clib/asl_protos.h>
  35. #include <clib/reqtools_protos.h>
  36. #include <clib/gadtools_protos.h>
  37. #include <clib/alib_protos.h>
  38. #include <pragmas/exec_pragmas.h>       // pragmas
  39. #include <pragmas/intuition_pragmas.h>
  40. #include <pragmas/dos_pragmas.h>
  41. #include <pragmas/locale_pragmas.h>
  42. #include <pragmas/asl_pragmas.h>
  43. #include <pragmas/reqtools_pragmas.h>
  44. #include <pragmas/gadtools_pragmas.h>
  45. #include <pragmas/rexxsyslib_pragmas.h>
  46.  
  47.  
  48. #include "DEV_IE:defs.h"
  49. #include "DEV_IE:GUI.h"
  50. #include "DEV_IE:GUI_locale.h"
  51. ///
  52. /// Prototypes
  53. static struct WindowInfo   *GimmeWnd( ULONG * );
  54. static BOOL                 ActivateWnd( ULONG * );
  55. ///
  56. /// Data
  57. static UBYTE stem_ScreenTitle[] = ".SCREENTITLE";
  58. static UBYTE stem_Title[]       = ".TITLE";
  59. static UBYTE stem_Label[]       = ".LABEL";
  60. static UBYTE stem_TopEdge[]     = ".TOPEDGE";
  61. static UBYTE stem_LeftEdge[]    = ".LEFTEDGE";
  62. static UBYTE stem_Width[]       = ".WIDTH";
  63. static UBYTE stem_Height[]      = ".HEIGHT";
  64. static UBYTE stem_MinWidth[]    = ".MINWIDTH";
  65. static UBYTE stem_MinHeight[]   = ".MINHEIGHT";
  66. static UBYTE stem_MaxWidth[]    = ".MAXWIDTH";
  67. static UBYTE stem_MaxHeight[]   = ".MAXHEIGHT";
  68. static UBYTE stem_InnerWidth[]  = ".INNERWIDTH";
  69. static UBYTE stem_InnerHeight[] = ".INNERHEIGHT";
  70. static UBYTE stem_MouseQueue[]  = ".MOUSEQUEUE";
  71. static UBYTE stem_RptQueue[]    = ".RPTQUEUE";
  72. static UBYTE stem_ZLeft[]       = ".ZOOMLEFT";
  73. static UBYTE stem_ZTop[]        = ".ZOOMTOP";
  74. static UBYTE stem_ZWidth[]      = ".ZOOMWIDTH";
  75. static UBYTE stem_ZHeight[]     = ".ZOOMHEIGHT";
  76. static UBYTE stem_NumGads[]     = ".NUMGADS";
  77. static UBYTE stem_NumMenus[]    = ".NUMMENUS";
  78. static UBYTE stem_NumBoxes[]    = ".NUMBOXES";
  79. static UBYTE stem_NumTexts[]    = ".NUMTEXTS";
  80. static UBYTE stem_NumBools[]    = ".NUMBOOLS";
  81. static UBYTE stem_NumImages[]   = ".NUMIMAGES";
  82. static UBYTE stem_IDCMP[]       = ".IDCMP";
  83. static UBYTE stem_Tags[]        = ".TAGS";
  84. static UBYTE stem_Depth[]       = ".DEPTH";
  85. static UBYTE stem_PlanePick[]   = ".PLANEPICK";
  86. static UBYTE stem_PlaneOnOff[]  = ".PLANEONOFF";
  87. static UBYTE stem_FrontPen[]    = ".FRONTPEN";
  88. static UBYTE stem_BackPen[]     = ".BACKPEN";
  89. static UBYTE stem_DrawMode[]    = ".DRAWMODE";
  90. static UBYTE stem_Font[]        = ".FONT";
  91. static UBYTE stem_Text[]        = ".TEXT";
  92. static UBYTE stem_Type[]        = ".TYPE";
  93. static UBYTE stem_Recessed[]    = ".RECESSED";
  94. static UBYTE stem_Name[]        = ".NAME";
  95. static UBYTE stem_Style[]       = ".STYLE";
  96. static UBYTE stem_Flags[]       = ".FLAGS";
  97. static UBYTE stem_YSize[]       = ".YSIZE";
  98.  
  99. static UBYTE ld_fmt[]           = "%ld";
  100. ///
  101.  
  102.  
  103. // Support Routines
  104. /// GimmeWnd
  105. struct WindowInfo *GimmeWnd( ULONG *Cnt )
  106. {
  107.     struct WindowInfo  *wnd;
  108.     UWORD               c;
  109.  
  110.     if( Cnt ) {
  111.     if( *Cnt <= IE.num_win ) {
  112.  
  113.         wnd = (struct WindowInfo *)&IE.win_list;
  114.         for( c = 0; c < *Cnt; c++ )
  115.         wnd = wnd->wi_succ;
  116.  
  117.         return( wnd );
  118.  
  119.     }
  120.     } else {
  121.     return( IE.win_info );
  122.     }
  123.  
  124.     return( NULL );
  125. }
  126. ///
  127. /// ActivateWnd
  128. BOOL ActivateWnd( ULONG *Cnt )
  129. {
  130.     BOOL                ret = TRUE;
  131.     struct WindowInfo  *wnd;
  132.  
  133.     if( wnd = GimmeWnd( Cnt )) {
  134.     if( wnd->wi_flags1 & W_APERTA ) {
  135.  
  136.         ActivateWindow( wnd->wi_winptr );
  137.  
  138.         IE.win_active = wnd->wi_winptr;
  139.         IE.win_info   = wnd;
  140.     } else {
  141.         ret = FALSE;
  142.     }
  143.     } else {
  144.     ret = FALSE;
  145.     }
  146.  
  147.     return( ret );
  148. }
  149. ///
  150.  
  151.  
  152. //      A
  153. /// AddBox
  154. LONG AddBoxRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  155. {
  156.     struct WindowInfo      *wnd;
  157.     UBYTE                   buffer[12];
  158.     struct BevelBoxNode    *box;
  159.  
  160.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  161.     return( RC_ERROR );
  162.  
  163.     if(!( box = AllocObject( IE_BEVELBOX )))
  164.     return( RC_FATAL );
  165.  
  166.     AddTail(( struct List * )&wnd->wi_Boxes, (struct Node *)box );
  167.  
  168.     wnd->wi_NumBoxes += 1;
  169.     IE.flags &= ~SALVATO;
  170.  
  171.     box->bb_VITag       = GT_VisualInfo;
  172.     box->bb_VisualInfo  = VisualInfo;
  173.     box->bb_RTag        = TAG_IGNORE;
  174.     box->bb_TTag        = GTBB_FrameType;
  175.  
  176.     box->bb_Left      = *((ULONG *)ArgArray[1]);
  177.     box->bb_Top       = *((ULONG *)ArgArray[2]);
  178.     box->bb_Width     = *((ULONG *)ArgArray[3]);
  179.     box->bb_Height    = *((ULONG *)ArgArray[4]);
  180.     box->bb_FrameType = *((ULONG *)ArgArray[5]);
  181.  
  182.     if( ArgArray[6] ) {
  183.     box->bb_Recessed = TRUE;
  184.     box->bb_RTag     = GTBB_Recessed;
  185.     }
  186.  
  187.     if( wnd->wi_flags1 & W_APERTA ) {
  188.  
  189.     ActivateWindow( wnd->wi_winptr );
  190.     IE.win_info   = wnd;
  191.     IE.win_active = wnd->wi_winptr;
  192.  
  193.     RinfrescaFinestra();
  194.     CheckMenuToActive();
  195.     }
  196.  
  197.     sprintf( buffer, ld_fmt, wnd->wi_NumBoxes );
  198.     Msg->rm_Result2 = CreateArgstring( buffer, strlen( buffer ));
  199.  
  200.     return( RC_OK );
  201. }
  202. ///
  203. /// AddIText
  204. LONG AddITextRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  205. {
  206.     struct ITextNode   *txt, *pred;
  207.     UWORD               cnt, num;
  208.     struct TxtAttrNode *fnt;
  209.     struct WindowInfo  *wnd;
  210.     UBYTE               buffer[12];
  211.  
  212.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  213.     return( RC_ERROR );
  214.  
  215.     if(!( txt = AllocObject( IE_INTUITEXT )))
  216.     return( RC_FATAL );
  217.  
  218.     AddTail(( struct List * )&wnd->wi_ITexts, (struct Node *)txt );
  219.  
  220.     wnd->wi_NumTexts += 1;
  221.     IE.flags &= ~SALVATO;
  222.  
  223.     txt->itn_Node.ln_Type = IT_SCRFONT;
  224.  
  225.     txt->itn_FrontPen = *((ULONG *)ArgArray[1]);
  226.     txt->itn_BackPen  = *((ULONG *)ArgArray[2]);
  227.     txt->itn_DrawMode = *((ULONG *)ArgArray[3]);
  228.     txt->itn_LeftEdge = *((ULONG *)ArgArray[4]);
  229.     txt->itn_TopEdge  = *((ULONG *)ArgArray[5]);
  230.     strcpy( txt->itn_Text, (STRPTR)ArgArray[6] );
  231.  
  232.     txt->itn_Node.ln_Name = txt->itn_IText = txt->itn_Text;
  233.  
  234.     pred = txt->itn_Node.ln_Pred;
  235.     if( pred->itn_Node.ln_Pred )
  236.     pred->itn_NextText = &txt->itn_FrontPen;
  237.  
  238.     if( ArgArray[7] ) {
  239.  
  240.     fnt = IE.FntLst.mlh_Head;
  241.     num = *((ULONG *)ArgArray[7]) - 1;
  242.     for( cnt = 0; cnt < num; cnt++ )
  243.         if(!( fnt = fnt->txa_Next ))
  244.         goto no;
  245.  
  246.     fnt->txa_OpenCnt += 1;
  247.  
  248.     txt->itn_FontCopy = txt->itn_ITextFont = &fnt->txa_FontName;
  249.     txt->itn_Node.ln_Type = 0;
  250.     }
  251.  
  252. no:
  253.  
  254.     if( wnd->wi_flags1 & W_APERTA ) {
  255.  
  256.     ActivateWindow( wnd->wi_winptr );
  257.     IE.win_info   = wnd;
  258.     IE.win_active = wnd->wi_winptr;
  259.  
  260.     RinfrescaFinestra();
  261.     CheckMenuToActive();
  262.     }
  263.  
  264.     sprintf( buffer, ld_fmt, wnd->wi_NumTexts );
  265.     Msg->rm_Result2 = CreateArgstring( buffer, strlen( buffer ));
  266.  
  267.     return( RC_OK );
  268. }
  269. ///
  270.  
  271. //      G
  272. /// Generate
  273. LONG GenerateRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  274. {
  275.     struct Generator    *gbase, *other = NULL;
  276.  
  277.     if( ArgArray[1] )
  278.     strcpy( allpath2, (STRPTR)ArgArray[1] );
  279.  
  280.     if(!( ArgArray[0] ))
  281.     IE.flags_2 |= REXXCALL;
  282.  
  283.     if( ArgArray[2] ) {
  284.     UBYTE   buffer[256];
  285.  
  286.     strcpy( buffer, "PROGDIR:Generators/" );
  287.     strcat( buffer, (STRPTR)ArgArray[2] );
  288.  
  289.     gbase = GenBase;
  290.  
  291.     if(!( GenBase = ( struct Generator * )OpenLibrary( buffer, 37 )))
  292.         GenBase = gbase;
  293.     else
  294.         other = GenBase;
  295.     }
  296.  
  297.     GeneraMenued();
  298.  
  299.     if( ArgArray[2] ) {
  300.     GenBase = gbase;
  301.     if( other )
  302.         CloseLibrary(( struct Library * )other );
  303.     }
  304.  
  305.     IE.flags_2 &= ~REXXCALL;
  306.  
  307.     return( RC_OK );
  308. }
  309. ///
  310. /// GetActWndData
  311. LONG GetActWndDataRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  312. {
  313.     ULONG   ret;
  314.  
  315.     if( IE.win_info ) {
  316.     ULONG   num;
  317.  
  318.     num = GetNodeNum( &IE.win_list, IE.win_info ) + 1;
  319.  
  320.     ArgArray[1] = ArgArray[0];
  321.     ArgArray[0] = (ULONG)#
  322.  
  323.     ret = GetWndDataRexxed( ArgArray, Msg );
  324.  
  325.     } else
  326.     return( RC_WARN );
  327.  
  328.     return( ret );
  329. }
  330. ///
  331. /// GetBox
  332. LONG GetBoxRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  333. {
  334.     struct BevelBoxNode *box;
  335.     UBYTE                buf[12];
  336.  
  337.     if( ActivateWnd( (ULONG *)ArgArray[0] )) {
  338.  
  339.     if(!( IE.win_info->wi_NumBoxes ))
  340.         return( RC_WARN );
  341.  
  342.     if( box = GetBox() ) {
  343.  
  344.         sprintf( buf, ld_fmt, GetNodeNum( &IE.win_info->wi_Boxes, box ) + 1 );
  345.  
  346.         if(!( Msg->rm_Result2 = CreateArgstring( buf, strlen( buf ))))
  347.         return( RC_FATAL );
  348.  
  349.     } else {
  350.         return( RC_WARN );
  351.     }
  352.  
  353.     } else {
  354.     return( RC_ERROR );
  355.     }
  356.  
  357.     return( RC_OK );
  358. }
  359. ///
  360. /// GetBoxAttr
  361. LONG GetBoxAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  362. {
  363.     struct WindowInfo      *wnd;
  364.     struct BevelBoxNode    *box;
  365.     UWORD                   cnt, len;
  366.     UBYTE                   buffer[256], num[12];
  367.  
  368.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  369.     return( RC_ERROR );
  370.  
  371.     cnt = *((ULONG *)ArgArray[1]);
  372.  
  373.     if((!( wnd->wi_NumBoxes )) || ( cnt > wnd->wi_NumBoxes ))
  374.     return( RC_WARN );
  375.  
  376.     for( box = wnd->wi_Boxes.mlh_Head, len = 1; len < cnt; len++ )
  377.     box = box->bb_Next;
  378.  
  379.     strcpy( buffer, (STRPTR)ArgArray[2] );
  380.     len = strlen( buffer );
  381.  
  382.     strcat( buffer, stem_LeftEdge );
  383.     sprintf( num, ld_fmt, box->bb_Left );
  384.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  385.     return( RC_FATAL );
  386.  
  387.     buffer[ len ] = '\0';
  388.     strcat( buffer, stem_TopEdge );
  389.     sprintf( num, ld_fmt, box->bb_Top );
  390.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  391.     return( RC_FATAL );
  392.  
  393.     buffer[ len ] = '\0';
  394.     strcat( buffer, stem_Width );
  395.     sprintf( num, ld_fmt, box->bb_Width );
  396.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  397.     return( RC_FATAL );
  398.  
  399.     buffer[ len ] = '\0';
  400.     strcat( buffer, stem_Height );
  401.     sprintf( num, ld_fmt, box->bb_Height );
  402.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  403.     return( RC_FATAL );
  404.  
  405.     buffer[ len ] = '\0';
  406.     strcat( buffer, stem_Type );
  407.     sprintf( num, ld_fmt, box->bb_FrameType );
  408.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  409.     return( RC_FATAL );
  410.  
  411.     buffer[ len ] = '\0';
  412.     strcat( buffer, stem_Recessed );
  413.     sprintf( num, ld_fmt, box->bb_Recessed & 1 );
  414.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  415.     return( RC_FATAL );
  416.  
  417.     return( RC_OK );
  418. }
  419. ///
  420. /// GetDriPen
  421. LONG GetDriPenRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  422. {
  423.     UBYTE               num[12];
  424.     struct DrawInfo    *dri;
  425.     UWORD               pen;
  426.  
  427.     if( dri = GetScreenDrawInfo( Scr )) {
  428.  
  429.     pen = *(( ULONG * )ArgArray[0] );
  430.  
  431.     if( pen >= dri->dri_NumPens )
  432.         return( RC_FATAL );
  433.  
  434.     sprintf( num, ld_fmt, dri->dri_Pens[ pen ] );
  435.  
  436.     FreeScreenDrawInfo( Scr, dri );
  437.  
  438.     if(!( Msg->rm_Result2 = CreateArgstring( num, strlen( num ))))
  439.         return( RC_FATAL );
  440.  
  441.     } else {
  442.     return( RC_FATAL );
  443.     }
  444.  
  445.     return( RC_OK );
  446. }
  447. ///
  448. /// GetFontAttr
  449. LONG GetFontAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  450. {
  451.     UBYTE               buffer[255], num[12];
  452.     UWORD               len, cnt;
  453.     struct TxtAttrNode *fnt;
  454.  
  455.     strcpy( buffer, (STRPTR)ArgArray[1] );
  456.  
  457.     fnt = IE.FntLst.mlh_Head;
  458.     len = *((ULONG *)ArgArray[0]);
  459.     for( cnt = 1; cnt < len; cnt++ )
  460.     if(!( fnt = fnt->txa_Next ))
  461.         return( RC_ERROR );
  462.  
  463.     len = strlen( buffer );
  464.  
  465.     strcat( buffer, stem_Style );
  466.     sprintf( num, ld_fmt, fnt->txa_Style );
  467.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  468.     return( RC_FATAL );
  469.  
  470.     buffer[ len ] = '\0';
  471.     strcat( buffer, stem_Flags );
  472.     sprintf( num, ld_fmt, fnt->txa_Flags );
  473.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  474.     return( RC_FATAL );
  475.  
  476.     buffer[ len ] = '\0';
  477.     strcat( buffer, stem_YSize );
  478.     sprintf( num, ld_fmt, fnt->txa_Size );
  479.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  480.     return( RC_FATAL );
  481.  
  482.     buffer[ len ] = '\0';
  483.     strcat( buffer, stem_Name );
  484.     if( SetRexxVar( (struct Message *)Msg, buffer, fnt->txa_FontName, strlen( fnt->txa_FontName )))
  485.     return( RC_FATAL );
  486.  
  487.     return( RC_OK );
  488. }
  489. ///
  490. /// GetFile
  491. LONG GetFileRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  492. {
  493.     UBYTE FileBuf[64], DrawerBuf[256], All[512];
  494.  
  495.     if( ArgArray[1] )
  496.     strcpy( FileBuf, (STRPTR)ArgArray[1] );
  497.     else
  498.     strcpy( FileBuf, initial_file );
  499.  
  500.     if( ArgArray[2] )
  501.     strcpy( DrawerBuf, (STRPTR)ArgArray[2] );
  502.     else
  503.     strcpy( DrawerBuf, initial_drawer );
  504.  
  505.     if( GetFile3( ArgArray[4], (STRPTR)ArgArray[0],
  506.           (STRPTR)ArgArray[3], 0, NULL,
  507.           FileBuf, DrawerBuf )) {
  508.  
  509.     strcpy( All, DrawerBuf );
  510.     AddPart( All, FileBuf, 512 );
  511.  
  512.     if(!( Msg->rm_Result2 = CreateArgstring( All, strlen( All ))))
  513.         return( RC_FATAL );
  514.  
  515.     } else {
  516.     return( RC_WARN );
  517.     }
  518.  
  519.     return( RC_OK );
  520. }
  521. ///
  522. /// GetImg
  523. LONG GetImgRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  524. {
  525.     struct WndImages   *img;
  526.     UBYTE               buf[12];
  527.  
  528.     if( ActivateWnd( (ULONG *)ArgArray[0] )) {
  529.  
  530.     if(!( IE.win_info->wi_NumImages ))
  531.         return( RC_WARN );
  532.  
  533.     if( img = GetImg() ) {
  534.  
  535.         sprintf( buf, ld_fmt, GetNodeNum( &IE.win_info->wi_Images, img ) + 1 );
  536.  
  537.         if(!( Msg->rm_Result2 = CreateArgstring( buf, strlen( buf ))))
  538.         return( RC_FATAL );
  539.  
  540.     } else {
  541.         return( RC_WARN );
  542.     }
  543.  
  544.     } else {
  545.     return( RC_ERROR );
  546.     }
  547.  
  548.     return( RC_OK );
  549. }
  550. ///
  551. /// GetImgAttr
  552. LONG GetImgAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  553. {
  554.     struct WindowInfo  *wnd;
  555.     struct WndImages   *img;
  556.     UWORD               cnt, len;
  557.     UBYTE               buffer[256], num[12];
  558.  
  559.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  560.     return( RC_ERROR );
  561.  
  562.     cnt = *((ULONG *)ArgArray[1]);
  563.  
  564.     if((!( wnd->wi_NumImages )) || ( cnt > wnd->wi_NumImages ))
  565.     return( RC_WARN );
  566.  
  567.     for( img = wnd->wi_Images.mlh_Head, len = 1; len < cnt; len++ )
  568.     img = img->wim_Next;
  569.  
  570.     strcpy( buffer, (STRPTR)ArgArray[2] );
  571.     len = strlen( buffer );
  572.  
  573.     strcat( buffer, stem_LeftEdge );
  574.     sprintf( num, ld_fmt, img->wim_Left );
  575.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  576.     return( RC_FATAL );
  577.  
  578.     buffer[ len ] = '\0';
  579.     strcat( buffer, stem_TopEdge );
  580.     sprintf( num, ld_fmt, img->wim_Top );
  581.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  582.     return( RC_FATAL );
  583.  
  584.     buffer[ len ] = '\0';
  585.     strcat( buffer, stem_Width );
  586.     sprintf( num, ld_fmt, img->wim_Width );
  587.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  588.     return( RC_FATAL );
  589.  
  590.     buffer[ len ] = '\0';
  591.     strcat( buffer, stem_Height );
  592.     sprintf( num, ld_fmt, img->wim_Height );
  593.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  594.     return( RC_FATAL );
  595.  
  596.     buffer[ len ] = '\0';
  597.     strcat( buffer, stem_Depth );
  598.     sprintf( num, ld_fmt, img->wim_Depth );
  599.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  600.     return( RC_FATAL );
  601.  
  602.     buffer[ len ] = '\0';
  603.     strcat( buffer, stem_PlanePick );
  604.     sprintf( num, ld_fmt, img->wim_PlanePick );
  605.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  606.     return( RC_FATAL );
  607.  
  608.     buffer[ len ] = '\0';
  609.     strcat( buffer, stem_PlaneOnOff );
  610.     sprintf( num, ld_fmt, img->wim_PlaneOnOff );
  611.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  612.     return( RC_FATAL );
  613.  
  614.     return( RC_OK );
  615. }
  616. ///
  617. /// GetIText
  618. LONG GetITextRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  619. {
  620.     struct ITextNode   *txt;
  621.     UBYTE               num[12];
  622.  
  623.     if(!( ActivateWnd(( ULONG * )ArgArray[0] )))
  624.     return( RC_ERROR );
  625.  
  626.     if(!( IE.win_info->wi_NumTexts ))
  627.     return( RC_WARN );
  628.  
  629.     if( txt = GetText() ) {
  630.  
  631.     sprintf( num, ld_fmt, GetNodeNum( &IE.win_info->wi_ITexts, txt ) + 1 );
  632.  
  633.     if(!( Msg->rm_Result2 = CreateArgstring( num, strlen( num ))))
  634.         return( RC_FATAL );
  635.  
  636.     } else {
  637.     return( RC_WARN );
  638.     }
  639.  
  640.     return( RC_OK );
  641. }
  642. ///
  643. /// GetITextAttr
  644. LONG GetITextAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  645. {
  646.     UBYTE               buffer[255], num[12];
  647.     UWORD               len;
  648.     WORD                cnt;
  649.     struct ITextNode   *txt;
  650.     struct WindowInfo  *wnd;
  651.  
  652.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  653.     return( RC_ERROR );
  654.  
  655.     if(!( wnd->wi_NumTexts ))
  656.     return( RC_WARN );
  657.  
  658.     strcpy( buffer, (STRPTR)ArgArray[2] );
  659.  
  660.     txt = wnd->wi_ITexts.mlh_Head;
  661.     len = *((ULONG *)ArgArray[1]);
  662.     for( cnt = 1; cnt < len; cnt++ )
  663.     txt = txt->itn_Node.ln_Succ;
  664.  
  665.     len = strlen( buffer );
  666.  
  667.     strcat( buffer, stem_FrontPen );
  668.     sprintf( num, ld_fmt, txt->itn_FrontPen );
  669.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  670.     return( RC_FATAL );
  671.  
  672.     buffer[ len ] = '\0';
  673.     strcat( buffer, stem_BackPen );
  674.     sprintf( num, ld_fmt, txt->itn_BackPen );
  675.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  676.     return( RC_FATAL );
  677.  
  678.     buffer[ len ] = '\0';
  679.     strcat( buffer, stem_DrawMode );
  680.     sprintf( num, ld_fmt, txt->itn_DrawMode );
  681.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  682.     return( RC_FATAL );
  683.  
  684.     buffer[ len ] = '\0';
  685.     strcat( buffer, stem_LeftEdge );
  686.     sprintf( num, ld_fmt, txt->itn_LeftEdge );
  687.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  688.     return( RC_FATAL );
  689.  
  690.     buffer[ len ] = '\0';
  691.     strcat( buffer, stem_TopEdge );
  692.     sprintf( num, ld_fmt, txt->itn_TopEdge );
  693.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  694.     return( RC_FATAL );
  695.  
  696.     buffer[ len ] = '\0';
  697.     strcat( buffer, stem_Text );
  698.     if( SetRexxVar( (struct Message *)Msg, buffer, txt->itn_IText, strlen( txt->itn_IText )))
  699.     return( RC_FATAL );
  700.  
  701.     buffer[ len ] = '\0';
  702.     strcat( buffer, stem_Font );
  703.  
  704.     if( txt->itn_ITextFont ) {
  705.  
  706.     struct TxtAttrNode *fnt;
  707.  
  708.     fnt = (struct TxtAttrNode *)((ULONG)txt->itn_ITextFont - 14);
  709.     cnt = GetNodeNum( &IE.FntLst, fnt ) + 1;
  710.  
  711.     } else {
  712.     cnt = -1;
  713.     }
  714.  
  715.     sprintf( num, ld_fmt, cnt );
  716.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  717.     return( RC_FATAL );
  718.  
  719.     return( RC_OK );
  720. }
  721. ///
  722. /// GetName
  723. LONG GetNameRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  724. {
  725.     if( Msg->rm_Result2 = CreateArgstring( save_file, strlen( save_file )))
  726.     return( RC_OK );
  727.     else
  728.     return( RC_FATAL );
  729. }
  730. ///
  731. /// GetScrFont
  732. LONG GetScrFontRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  733. {
  734.     UBYTE   buffer[256], num[12];
  735.     UWORD   len;
  736.  
  737.     len  = strlen( (STRPTR)ArgArray[0] );
  738.     strcpy( buffer, (STRPTR)ArgArray[0] );
  739.  
  740.     strcat( buffer, stem_Style );
  741.     sprintf( num, ld_fmt, Scr->Font->ta_Style );
  742.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  743.     return( RC_FATAL );
  744.  
  745.     buffer[ len ] = '\0';
  746.     strcat( buffer, stem_Flags );
  747.     sprintf( num, ld_fmt, Scr->Font->ta_Flags );
  748.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  749.     return( RC_FATAL );
  750.  
  751.     buffer[ len ] = '\0';
  752.     strcat( buffer, stem_YSize );
  753.     sprintf( num, ld_fmt, Scr->Font->ta_YSize );
  754.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  755.     return( RC_FATAL );
  756.  
  757.     buffer[ len ] = '\0';
  758.     strcat( buffer, stem_Name );
  759.     if( SetRexxVar( (struct Message *)Msg, buffer, Scr->Font->ta_Name, strlen( Scr->Font->ta_Name )))
  760.     return( RC_FATAL );
  761.  
  762.     return( RC_OK );
  763. }
  764. ///
  765. /// GetTxtLen
  766. LONG GetTxtLenRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  767. {
  768.     struct WindowInfo  *wnd;
  769.     struct ITextNode   *txt;
  770.     UWORD               len, cnt;
  771.     UBYTE               buf[12];
  772.  
  773.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  774.     return( RC_ERROR );
  775.  
  776.     if(!( wnd->wi_NumTexts ))
  777.     return( RC_WARN );
  778.  
  779.     txt = wnd->wi_ITexts.mlh_Head;
  780.     len = *((ULONG *)ArgArray[1]);
  781.     for( cnt = 1; cnt < len; cnt++ )
  782.     txt = txt->itn_Node.ln_Succ;
  783.  
  784.     sprintf( buf, ld_fmt, IntuiTextLength(( struct IntuiText *)&txt->itn_FrontPen ));
  785.  
  786.     if(!( Msg->rm_Result2 = CreateArgstring( buf, strlen( buf ))))
  787.     return( RC_FATAL );
  788.  
  789.     return( RC_OK );
  790. }
  791. ///
  792. /// GetWndData
  793. LONG GetWndDataRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  794. {
  795.     UBYTE               buffer[255], num[12];
  796.     UWORD               len;
  797.     struct WindowInfo  *wnd;
  798.  
  799.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  800.     return( RC_ERROR );
  801.  
  802.     strcpy( buffer, (STRPTR)ArgArray[1] );
  803.     len = strlen( buffer );
  804.  
  805.     strcat( buffer, stem_Title );
  806.     if( SetRexxVar( (struct Message *)Msg, buffer, wnd->wi_Titolo, strlen( wnd->wi_Titolo )))
  807.     return( RC_FATAL );
  808.  
  809.     buffer[ len ] = '\0';
  810.     strcat( buffer, stem_ScreenTitle );
  811.     if( SetRexxVar( (struct Message *)Msg, buffer, wnd->wi_TitoloSchermo, strlen( wnd->wi_TitoloSchermo )))
  812.     return( RC_FATAL );
  813.  
  814.     buffer[ len ] = '\0';
  815.     strcat( buffer, stem_Label );
  816.     if( SetRexxVar( (struct Message *)Msg, buffer, wnd->wi_Label, strlen( wnd->wi_Label )))
  817.     return( RC_FATAL );
  818.  
  819.     buffer[ len ] = '\0';
  820.     strcat( buffer, stem_TopEdge );
  821.     sprintf( num, ld_fmt, wnd->wi_Top );
  822.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  823.     return( RC_FATAL );
  824.  
  825.     buffer[ len ] = '\0';
  826.     strcat( buffer, stem_LeftEdge );
  827.     sprintf( num, ld_fmt, wnd->wi_Left );
  828.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  829.     return( RC_FATAL );
  830.  
  831.     buffer[ len ] = '\0';
  832.     strcat( buffer, stem_Width );
  833.     sprintf( num, ld_fmt, wnd->wi_Width );
  834.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  835.     return( RC_FATAL );
  836.  
  837.     buffer[ len ] = '\0';
  838.     strcat( buffer, stem_Height );
  839.     sprintf( num, ld_fmt, wnd->wi_Height );
  840.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  841.     return( RC_FATAL );
  842.  
  843.     buffer[ len ] = '\0';
  844.     strcat( buffer, stem_MinWidth );
  845.     sprintf( num, ld_fmt, wnd->wi_MinWidth );
  846.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  847.     return( RC_FATAL );
  848.  
  849.     buffer[ len ] = '\0';
  850.     strcat( buffer, stem_MinHeight );
  851.     sprintf( num, ld_fmt, wnd->wi_MinHeight );
  852.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  853.     return( RC_FATAL );
  854.  
  855.     buffer[ len ] = '\0';
  856.     strcat( buffer, stem_MaxWidth );
  857.     sprintf( num, ld_fmt, wnd->wi_MaxWidth );
  858.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  859.     return( RC_FATAL );
  860.  
  861.     buffer[ len ] = '\0';
  862.     strcat( buffer, stem_MaxHeight );
  863.     sprintf( num, ld_fmt, wnd->wi_MaxHeight );
  864.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  865.     return( RC_FATAL );
  866.  
  867.     buffer[ len ] = '\0';
  868.     strcat( buffer, stem_InnerWidth );
  869.     sprintf( num, ld_fmt, wnd->wi_InnerWidth );
  870.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  871.     return( RC_FATAL );
  872.  
  873.     buffer[ len ] = '\0';
  874.     strcat( buffer, stem_InnerHeight );
  875.     sprintf( num, ld_fmt, wnd->wi_InnerHeight );
  876.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  877.     return( RC_FATAL );
  878.  
  879.     buffer[ len ] = '\0';
  880.     strcat( buffer, stem_MouseQueue );
  881.     sprintf( num, ld_fmt, wnd->wi_MouseQueue );
  882.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  883.     return( RC_FATAL );
  884.  
  885.     buffer[ len ] = '\0';
  886.     strcat( buffer, stem_RptQueue );
  887.     sprintf( num, ld_fmt, wnd->wi_RptQueue );
  888.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  889.     return( RC_FATAL );
  890.  
  891.     buffer[ len ] = '\0';
  892.     strcat( buffer, stem_NumGads );
  893.     sprintf( num, ld_fmt, wnd->wi_NumGads );
  894.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  895.     return( RC_FATAL );
  896.  
  897.     buffer[ len ] = '\0';
  898.     strcat( buffer, stem_NumMenus );
  899.     sprintf( num, ld_fmt, wnd->wi_NumMenus );
  900.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  901.     return( RC_FATAL );
  902.  
  903.     buffer[ len ] = '\0';
  904.     strcat( buffer, stem_NumBoxes );
  905.     sprintf( num, ld_fmt, wnd->wi_NumBoxes );
  906.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  907.     return( RC_FATAL );
  908.  
  909.     buffer[ len ] = '\0';
  910.     strcat( buffer, stem_NumTexts );
  911.     sprintf( num, ld_fmt, wnd->wi_NumTexts );
  912.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  913.     return( RC_FATAL );
  914.  
  915.     buffer[ len ] = '\0';
  916.     strcat( buffer, stem_NumBools );
  917.     sprintf( num, ld_fmt, wnd->wi_NumBools );
  918.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  919.     return( RC_FATAL );
  920.  
  921.     buffer[ len ] = '\0';
  922.     strcat( buffer, stem_NumImages );
  923.     sprintf( num, ld_fmt, wnd->wi_NumImages );
  924.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  925.     return( RC_FATAL );
  926.  
  927.     buffer[ len ] = '\0';
  928.     strcat( buffer, stem_ZLeft );
  929.     sprintf( num, ld_fmt, wnd->wi_ZLeft );
  930.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  931.     return( RC_FATAL );
  932.  
  933.     buffer[ len ] = '\0';
  934.     strcat( buffer, stem_ZTop );
  935.     sprintf( num, ld_fmt, wnd->wi_ZTop );
  936.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  937.     return( RC_FATAL );
  938.  
  939.     buffer[ len ] = '\0';
  940.     strcat( buffer, stem_ZWidth );
  941.     sprintf( num, ld_fmt, wnd->wi_ZWidth );
  942.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  943.     return( RC_FATAL );
  944.  
  945.     buffer[ len ] = '\0';
  946.     strcat( buffer, stem_ZHeight );
  947.     sprintf( num, ld_fmt, wnd->wi_ZHeight );
  948.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  949.     return( RC_FATAL );
  950.  
  951.     buffer[ len ] = '\0';
  952.     strcat( buffer, stem_IDCMP );
  953.     sprintf( num, ld_fmt, wnd->wi_IDCMP );
  954.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  955.     return( RC_FATAL );
  956.  
  957.     buffer[ len ] = '\0';
  958.     strcat( buffer, stem_Flags );
  959.     sprintf( num, ld_fmt, wnd->wi_Flags );
  960.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  961.     return( RC_FATAL );
  962.  
  963.     buffer[ len ] = '\0';
  964.     strcat( buffer, stem_Tags );
  965.     sprintf( num, ld_fmt, wnd->wi_Tags );
  966.     if( SetRexxVar( (struct Message *)Msg, buffer, num, strlen( num )))
  967.     return( RC_FATAL );
  968.  
  969.     return( RC_OK );
  970. }
  971. ///
  972.  
  973. //      N
  974. /// New
  975. LONG NewRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  976. {
  977.     IE.flags |= SALVATO;
  978.     NuovoMenued();
  979.     return( RC_OK );
  980. }
  981. ///
  982.  
  983. //      O
  984. /// Open
  985. LONG OpenRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  986. {
  987.     if(!( ArgArray[0] )) {
  988.  
  989.     strcpy( allpath2, (STRPTR)ArgArray[1] );
  990.  
  991.     if(!( IE.flags_2 & DEMO ))
  992.         strcpy( save_file, allpath2 );
  993.  
  994.     IE.flags |= LOADGUI;
  995.     }
  996.  
  997.     NewRexxed( NULL, NULL );
  998.  
  999.     CaricaMenued();
  1000.  
  1001.     return( RC_OK );
  1002. }
  1003. ///
  1004.  
  1005. //      Q
  1006. /// Quit
  1007. LONG QuitRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1008. {
  1009.     Ok_to_Run = FALSE;
  1010.     IE.flags |= SALVATO;
  1011.     return( RC_OK );
  1012. }
  1013. ///
  1014.  
  1015. //      S
  1016. /// Save
  1017. LONG SaveRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1018. {
  1019.     if( IE.flags & DEMO )
  1020.     return( 15 );
  1021.  
  1022.     SalvaMenued();
  1023.     return( RC_OK );
  1024. }
  1025. ///
  1026. /// SaveAs
  1027. LONG SaveAsRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1028. {
  1029.     if( IE.flags & DEMO )
  1030.     return( 15 );
  1031.  
  1032.     save_file[0] = '\0';
  1033.  
  1034.     if( ArgArray[1] )
  1035.     strcpy( save_file, (STRPTR)ArgArray[1] );
  1036.  
  1037.     if( ArgArray[0] )
  1038.     SalvaComeMenued();
  1039.     else
  1040.     SalvaMenued();
  1041.  
  1042.     return( RC_OK );
  1043. }
  1044. ///
  1045. /// SetBoxAttr
  1046. LONG SetBoxAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1047. {
  1048.     struct WindowInfo      *wnd;
  1049.     struct BevelBoxNode    *box;
  1050.     UWORD                   num, cnt;
  1051.  
  1052.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  1053.     return( RC_ERROR );
  1054.  
  1055.     num = *((ULONG *)ArgArray[1]);
  1056.  
  1057.     if((!( wnd->wi_NumBoxes )) || ( num > wnd->wi_NumBoxes ))
  1058.     return( RC_WARN );
  1059.  
  1060.     box = wnd->wi_Boxes.mlh_Head;
  1061.  
  1062.     for( cnt = 1; cnt < num; cnt++ )
  1063.     box = box->bb_Next;
  1064.  
  1065.     if( ArgArray[2] )
  1066.     box->bb_Left      = *((ULONG *)ArgArray[2]);
  1067.  
  1068.     if( ArgArray[3] )
  1069.     box->bb_Top       = *((ULONG *)ArgArray[3]);
  1070.  
  1071.     if( ArgArray[4] )
  1072.     box->bb_Width     = *((ULONG *)ArgArray[4]);
  1073.  
  1074.     if( ArgArray[5] )
  1075.     box->bb_Height    = *((ULONG *)ArgArray[5]);
  1076.  
  1077.     if( ArgArray[6] )
  1078.     box->bb_FrameType = *((ULONG *)ArgArray[6]);
  1079.  
  1080.     if( ArgArray[7] ) {
  1081.     if( box->bb_Recessed ) {
  1082.         box->bb_Recessed = FALSE;
  1083.         box->bb_RTag     = TAG_IGNORE;
  1084.     } else {
  1085.         box->bb_Recessed = TRUE;
  1086.         box->bb_RTag     = GTBB_Recessed;
  1087.     }
  1088.     }
  1089.  
  1090.     if( wnd->wi_flags1 & W_APERTA ) {
  1091.  
  1092.     IE.win_active = wnd->wi_winptr;
  1093.     IE.win_info   = wnd;
  1094.  
  1095.     ActivateWindow( wnd->wi_winptr );
  1096.  
  1097.     RinfrescaFinestra();
  1098.     }
  1099.  
  1100.     IE.flags &= ~SALVATO;
  1101.  
  1102.     return( RC_OK );
  1103. }
  1104. ///
  1105. /// SetImgAttr
  1106. LONG SetImgAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1107. {
  1108.     struct WindowInfo  *wnd;
  1109.     struct WndImages   *img;
  1110.     UWORD               num, cnt;
  1111.  
  1112.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  1113.     return( RC_ERROR );
  1114.  
  1115.     num = *((ULONG *)ArgArray[1]);
  1116.  
  1117.     if((!( wnd->wi_NumImages )) || ( num > wnd->wi_NumImages ))
  1118.     return( RC_WARN );
  1119.  
  1120.     img = wnd->wi_Images.mlh_Head;
  1121.  
  1122.     for( cnt = 1; cnt < num; cnt++ )
  1123.     img = img->wim_Next;
  1124.  
  1125.     if( ArgArray[2] )
  1126.     img->wim_Left = *((ULONG *)ArgArray[2]);
  1127.  
  1128.     if( ArgArray[3] )
  1129.     img->wim_Top  = *((ULONG *)ArgArray[3]);
  1130.  
  1131.     if( wnd->wi_flags1 & W_APERTA ) {
  1132.  
  1133.     IE.win_active = wnd->wi_winptr;
  1134.     IE.win_info   = wnd;
  1135.  
  1136.     ActivateWindow( wnd->wi_winptr );
  1137.  
  1138.     RinfrescaFinestra();
  1139.     }
  1140.  
  1141.     IE.flags &= ~SALVATO;
  1142.  
  1143.     return( RC_OK );
  1144. }
  1145. ///
  1146. /// SetITextAttr
  1147. LONG SetITextAttrRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1148. {
  1149.     struct WindowInfo  *wnd;
  1150.     UWORD               num, cnt;
  1151.     struct ITextNode   *txt;
  1152.  
  1153.     if(!( wnd = GimmeWnd(( ULONG * )ArgArray[0] )))
  1154.     return( RC_ERROR );
  1155.  
  1156.     num = *(( ULONG * )ArgArray[1]);
  1157.  
  1158.     if((!( wnd->wi_NumTexts )) || ( num > wnd->wi_NumTexts ))
  1159.     return( RC_WARN );
  1160.  
  1161.     for( txt = wnd->wi_ITexts.mlh_Head, cnt = 1; cnt < num; cnt++ )
  1162.     txt = txt->itn_Node.ln_Succ;
  1163.  
  1164.     if( ArgArray[2] )
  1165.     txt->itn_FrontPen = *(( ULONG * )ArgArray[2]);
  1166.  
  1167.     if( ArgArray[3] )
  1168.     txt->itn_BackPen  = *(( ULONG * )ArgArray[3]);
  1169.  
  1170.     if( ArgArray[4] )
  1171.     txt->itn_DrawMode = *(( ULONG * )ArgArray[4]);
  1172.  
  1173.     if( ArgArray[5] )
  1174.     txt->itn_LeftEdge = *(( ULONG * )ArgArray[5]);
  1175.  
  1176.     if( ArgArray[6] )
  1177.     txt->itn_TopEdge  = *(( ULONG * )ArgArray[6]);
  1178.  
  1179.     if( ArgArray[7] ) {
  1180.  
  1181.     struct TxtAttrNode *fnt;
  1182.  
  1183.     fnt = IE.FntLst.mlh_Head;
  1184.     num = *((ULONG *)ArgArray[7]);
  1185.     for( cnt = 1; cnt < num; cnt++ )
  1186.         if(!( fnt = fnt->txa_Next ))
  1187.         return( RC_ERROR );
  1188.  
  1189.     fnt->txa_OpenCnt += 1;
  1190.  
  1191.     txt->itn_FontCopy = txt->itn_ITextFont = &fnt->txa_FontName;
  1192.     txt->itn_Node.ln_Type &= ~IT_SCRFONT;
  1193.     }
  1194.  
  1195.     if( ArgArray[8] )
  1196.     strcpy( txt->itn_Text, (STRPTR)ArgArray[8] );
  1197.  
  1198.     if( wnd->wi_flags1 & W_APERTA ) {
  1199.  
  1200.     IE.win_info   = wnd;
  1201.     IE.win_active = wnd->wi_winptr;
  1202.  
  1203.     ActivateWindow( wnd->wi_winptr );
  1204.  
  1205.     RinfrescaFinestra();
  1206.     }
  1207.  
  1208.     IE.flags &= ~SALVATO;
  1209.  
  1210.     return( RC_OK );
  1211. }
  1212. ///
  1213. /// SetName
  1214. LONG SetNameRexxed( ULONG *ArgArray, struct RexxMsg *Msg )
  1215. {
  1216.     strcpy( save_file, (STRPTR)ArgArray[0] );
  1217.     return( RC_OK );
  1218. }
  1219. ///
  1220.  
  1221.